betaVersus = function(a1, b1, a2, b2)
{
	par(mfcol=c(2,1));
	x = seq(0, 1, length=100);
	plot(x, dbeta(x, a1, b1), type="l");
	lines(x, dbeta(x, a2, b2), col="green");
	
	r1 = rbeta(1000, a1, b1);
	r2 = rbeta(1000, a2, b2);
	winsBy2 = r2 > r1;
	hist(as.numeric(winsBy2));
}

gammaVersus = function(shape1, shape2)
{
	par(mfcol=c(2,1));
	x = seq(0, 1, length=100);
	plot(x, dgamma(x, shape1), type="l");
	lines(x, dgamma(x, shape2), col="green");
	
	r1 = rgamma(1000, shape1);
	r2 = rgamma(1000, shape2);
	winsBy2 = r2 > r1;
	hist(as.numeric(winsBy2));
}